package com.freewater.javabase.demo.designpattern.command2.withundos.command;

import com.freewater.javabase.demo.designpattern.command2.withundos.receiver.Stereo;

/**
 * Created by FreeWater on 2017/4/4.
 */
public class StereoOnWithCDCommand implements Command {

	private Stereo stereo;

	public StereoOnWithCDCommand(Stereo stereo){
		this.stereo = stereo;
	}

	@Override
	public void execute() {
		this.stereo.on();
		this.stereo.setCD();
		this.stereo.setVolume(11);
	}

	@Override
	public void undo() {
		this.stereo.off();
	}
}
